** South Korean Cost Sensitivity and Support for Nuclear Weapons
** Kyung Suk Lee
** Incheon National Unification, Department of Political Science and International Studies, South Korea
** Latest Update: 04/04/2024

********************************************************************************

* Set working directory

* Import data
use masterdata, clear

********************************************************************************
** Main Text
********************************************************************************

********************************************************************************
** Table 2: Logit Regression Analysis of the Treatment Effects on Support for Nuclearization
********************************************************************************

eststo clear

eststo: logit supportA econcost humancost combinedcost, robust
eststo: logit supportA econcost humancost combinedcost Gender Age Edu Ideo PID Inter_intl Know_intl Mili Income, robust


esttab using table1.tex, replace booktabs alignment(l) ///
b(a3) se scalars("N Obs." "ll Log Likelihood" ) ///
title(My Table) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) nogaps //


********************************************************************************
** Figure 2: Marginal Effects on Support for Nuclearization
********************************************************************************

eststo clear
eststo: logit supportA econcost humancost combinedcost Gender Age Edu Ideo PID Inter_intl Know_intl Mili Income, robust
margins, dydx(econcost humancost combinedcost)
marginsplot,  plotopts(connect(none)) ytitle("Effects on Support for Nuclearization") ///
ylab(-0.5(.1)0.1, labsize(small) ) yline(0) ///
xlabel(1 "Economic Costs" 2 "Human Costs" 3 "Economic & Human Costs", labsize(small)) xscale(r(0.5(1)3.5)) ///
xtitle("Treatment Conditions") graphregion(color(white)) ///
title("") note("95% Confidence Interval", position(5)) 

graph export marginal.png, width(3000) replace


********************************************************************************
** Table 3: Logit Regression Analysis of South Koreans' Heterogeneous Cost Sensitivities
********************************************************************************

eststo clear
eststo: logit supportA i.econcost##i.Mili humancost combinedcost Gender Age Edu Ideo PID Inter_intl Know_intl Income, robust
eststo: logit supportA i.econcost humancost##i.Mili combinedcost Gender Age Edu Ideo PID Inter_intl Know_intl Income, robust
eststo: logit supportA i.econcost##i.Income_binary humancost combinedcost Gender Age Edu Ideo PID  Inter_intl Know_intl Mili, robust
eststo: logit supportA i.econcost humancost##i.Income_binary combinedcost Gender Age Edu Ideo PID Inter_intl Know_intl Mili, robust
eststo: logit supportA i.econcost##c.Ideo humancost combinedcost Gender Age Edu  PID Inter_intl Know_intl Mili Income, robust
eststo: logit supportA i.econcost humancost##c.Ideo combinedcost Gender Age Edu PID Inter_intl Know_intl Mili Income, robust

esttab using table1.tex, replace booktabs alignment(l)  ///
b(a3) se scalars("N Obs." "ll Log Likelihood" ) ///
title(My Table) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) nogaps  //


********************************************************************************
** Table 3: Marginal Effect Heterogeneous Cost Sensitivities
********************************************************************************
eststo: logit supportA i.econcost humancost##i.Mili combinedcost Gender Age Edu Ideo PID Inter_intl Know_intl Income, robust
margins, dydx(humancost) at(Mili==(0 1)) 
marginsplot, xscale(r(-0.5(1)1.5))  plotopts(connect(none)) ytitle("Effects on Support for Nuclearization") ///
ylab(-0.4(.1)0.1, labsize(small) ) xtitle("Individual Military Experience") yline(0) xlab(,  labsize(small)) title("") graphregion(color(white)) 


graph save military, replace

eststo: logit supportA i.econcost humancost##c.Ideo combinedcost Gender Age Edu PID Inter_intl Know_intl Mili Income, robust
margins, dydx(humancost) at(Ideo==(1 2 3)) 
marginsplot, plotopts(connect(none)) ytitle("Effects on Support for Nuclearization") ///
xlabel(1 "Conservative" 2 "Moderate" 3 "Liberal", labsize(small)) xscale(r(0.5(1)3.5)) ///  
ylab(-0.4(.1)0.1, labsize(small)) yline(0) yscale(off) ///
xtitle("Individual Political Ideology") graphregion(color(white) margin(r+5)) title("")

graph save PI, replace

graph combine military.gph PI.gph, graphregion(fcolor(white) ilcolor(white) lcolor(white)) note("95% Confidence Interval", position(5) size(vsmall))  

graph export hetero.png, width(3000) replace

********************************************************************************
** Online Appendix
********************************************************************************

********************************************************************************
** Table 1: Descriptive Statistics I
********************************************************************************
sum support if Group==1
sum support if Group==2
sum support if Group==3
sum support if Group==4


********************************************************************************
** Table 2: Descriptive Statistics II
********************************************************************************

sum support100A if Group==1
sum support100A if Group==2
sum support100A if Group==3
sum support100A if Group==4

********************************************************************************
** Table 4: Summary Statistics and Sample Characteristics
********************************************************************************
eststo clear
tabstat Gender Age Edu Ideo PID Inter_intl Know_intl Mili Income ///
Denuke UStroops_withdrawal Intl_reputation War Provo Nuclear /// 
Military Alliance Japan Endurance, format(%9.2g) c(stat) stat(n mean sd min max)


********************************************************************************
** Table 5: Logit Regression Analysis of the Possibility of Full-Scale War
********************************************************************************

eststo clear

eststo: logit War_binary econcost humancost combinedcost, robust
eststo: logit War_binary econcost humancost combinedcost Gender Age Edu Ideo PID Inter_intl Know_intl Mili Income, robust

esttab using table1.tex, replace booktabs alignment(l) ///
b(a3) se scalars("N Obs." "ll Log Likelihood" ) ///
title(My Table) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) nogaps //


********************************************************************************
** Table 6: Logit Regression Analysis of ROK's International Reputation
********************************************************************************

eststo clear

eststo: logit Intl_reputation_binary econcost humancost combinedcost, robust
eststo: logit Intl_reputation_binary econcost humancost combinedcost Gender Age Edu Ideo PID Inter_intl Know_intl Mili Income, robust

esttab using table1.tex, replace booktabs alignment(l) ///
b(a3) se scalars("N Obs." "ll Log Likelihood" ) ///
title(My Table) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) nogaps //

********************************************************************************
** Table 7: Robustness Check I: Logit Regression Analysis with All Control Variables
********************************************************************************

eststo clear
eststo: logit supportA econcost humancost combinedcost Gender Age Edu Ideo PID Inter_intl Know_intl Mili Income Denuke UStroops_withdrawal Intl_reputation War Provo Nuclear Military Alliance Japan Endurance, robust

esttab using table1.tex, replace booktabs alignment(l) ///
b(a3) se scalars("N Obs." "ll Log Likelihood" ) ///
title(My Table) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) nogaps //

********************************************************************************
** Table 8: Robustness Check II: Linear Probability Model
********************************************************************************

eststo clear

eststo: reg support100A econcost humancost combinedcost, robust
eststo: reg support100A econcost humancost combinedcost Gender Age Edu Ideo PID Inter_intl Know_intl Mili Income, robust
eststo: reg support100A econcost humancost combinedcost Gender Age Edu Ideo PID Inter_intl Know_intl Mili Income Denuke UStroops_withdrawal Intl_reputation War Provo  Nuclear Military  Alliance Japan Endurance, robust

esttab using table1.tex, replace booktabs alignment(l) ///
b(a3) se scalars("N Obs." "ll Log Likelihood" ) ///
title(My Table) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) nogaps //

********************************************************************************
** Table 9: Robustness Check III: Logit Regression Analysis (New Binary DV)
********************************************************************************

eststo clear
eststo: logit supportB econcost humancost combinedcost, robust
eststo: logit supportB econcost humancost combinedcost Gender Age Edu Ideo PID Inter_intl Know_intl Mili Income, robust
eststo: logit supportB econcost humancost combinedcost Gender Age Edu Ideo PID Inter_intl Know_intl Mili Income Denuke UStroops_withdrawal Intl_reputation War Provo  Nuclear Military  Alliance Japan Endurance, robust

esttab using table1.tex, replace booktabs alignment(l) ///
b(a3) se scalars("N Obs." "ll Log Likelihood" ) ///
title(My Table)  star(+ 0.10 * 0.05 ** 0.01 *** 0.001) nogaps //

********************************************************************************
** Table 10: Robustness Check IV: Ordered Logistic Regression Analysis
********************************************************************************

eststo clear
eststo: ologit support econcost humancost combinedcost, robust
eststo: ologit support econcost humancost combinedcost Gender Age Edu Ideo PID Inter_intl Know_intl Mili Income Denuke UStroops_withdrawal Intl_reputation War Provo Nuclear Military Alliance Japan Endurance, robust

esttab using table1.tex, replace booktabs alignment(l) ///
b(a3) se scalars("N Obs." "ll Log Likelihood" ) ///
title(My Table) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) nogaps //


********************************************************************************
** Table 11: Randomization Checks: Kolmogorov-Smirnov test for Covariate Balances
********************************************************************************

scalar drop _all

ksmirnov Gender if Group ==2 | Group ==1, by(Group) 
scalar a1 = round(r(D), .0001)
scalar a1p = round(r(p), .001)
ksmirnov Gender if Group ==3 | Group ==1, by(Group) 
scalar b1 = round(r(D), .0001)
scalar b1p = round(r(p), .001)
ksmirnov Gender if Group ==4 | Group ==1, by(Group) 
scalar c1 = round(r(D), .0001)
scalar c1p = round(r(p), .001)

ksmirnov Age if Group ==2 | Group ==1, by(Group) 
scalar a2 = round(r(D), .0001)
scalar a2p = round(r(p), .001)
ksmirnov Age if Group ==3 | Group ==1, by(Group) 
scalar b2 = round(r(D), .0001)
scalar b2p = round(r(p), .001)
ksmirnov Age if Group ==4 | Group ==1, by(Group) 
scalar c2 = round(r(D), .0001)
scalar c2p = round(r(p), .001)

ksmirnov Edu if Group ==2 | Group ==1, by(Group) 
scalar a3 = round(r(D), .0001)
scalar a3p = round(r(p), .001)
ksmirnov Edu if Group ==3 | Group ==1, by(Group) 
scalar b3 = round(r(D), .0001)
scalar b3p = round(r(p), .001)
ksmirnov Edu if Group ==4 | Group ==1, by(Group) 
scalar c3 = round(r(D), .0001)
scalar c3p = round(r(p), .001)

ksmirnov Ideo if Group ==2 | Group ==1, by(Group) 
scalar a4 = round(r(D), .0001)
scalar a4p = round(r(p), .001)
ksmirnov Ideo if Group ==3 | Group ==1, by(Group) 
scalar b4 = round(r(D), .0001)
scalar b4p = round(r(p), .001)
ksmirnov Ideo if Group ==4 | Group ==1, by(Group) 
scalar c4 = round(r(D), .0001)
scalar c4p = round(r(p), .001)

ksmirnov PID if Group ==2 | Group ==1, by(Group) 
scalar a5 = round(r(D), .0001)
scalar a5p = round(r(p), .001)
ksmirnov PID if Group ==3 | Group ==1, by(Group) 
scalar b5 = round(r(D), .0001)
scalar b5p = round(r(p), .001)
ksmirnov PID if Group ==4 | Group ==1, by(Group) 
scalar c5 = round(r(D), .0001)
scalar c5p = round(r(p), .001)

ksmirnov Inter_intl if Group ==2 | Group ==1, by(Group) 
scalar a6 = round(r(D), .0001)
scalar a6p = round(r(p), .001)
ksmirnov Inter_intl if Group ==3 | Group ==1, by(Group) 
scalar b6 = round(r(D), .0001)
scalar b6p = round(r(p), .001)
ksmirnov Inter_intl if Group ==4 | Group ==1, by(Group) 
scalar c6 = round(r(D), .0001)
scalar c6p = round(r(p), .001)

ksmirnov Know_intl if Group ==2 | Group ==1, by(Group) 
scalar a7 = round(r(D), .0001)
scalar a7p = round(r(p), .001)
ksmirnov Know_intl if Group ==3 | Group ==1, by(Group) 
scalar b7 = round(r(D), .0001)
scalar b7p = round(r(p), .001)
ksmirnov Know_intl if Group ==4 | Group ==1, by(Group) 
scalar c7 = round(r(D), .0001)
scalar c7p = round(r(p), .001)

ksmirnov Mili if Group ==2 | Group ==1, by(Group) 
scalar a8 = round(r(D), .0001)
scalar a8p = round(r(p), .001)
ksmirnov Mili if Group ==3 | Group ==1, by(Group) 
scalar b8= round(r(D), .0001)
scalar b8p = round(r(p), .001)
ksmirnov Mili if Group ==4 | Group ==1, by(Group) 
scalar c8 = round(r(D), .0001)
scalar c8p = round(r(p), .001)

ksmirnov Income if Group ==2 | Group ==1, by(Group) 
scalar a9 = round(r(D), .0001)
scalar a9p = round(r(p), .001)
ksmirnov Income if Group ==3 | Group ==1, by(Group) 
scalar b9 = round(r(D), .0001)
scalar b9p = round(r(p), .001)
ksmirnov Income if Group ==4 | Group ==1, by(Group) 
scalar c9 = round(r(D), .0001)
scalar c9p = round(r(p), .001)

ksmirnov Denuke if Group ==2 | Group ==1, by(Group) 
scalar a10 = round(r(D), .0001)
scalar a10p = round(r(p), .001)
ksmirnov Denuke if Group ==3 | Group ==1, by(Group) 
scalar b10 = round(r(D), .0001)
scalar b10p = round(r(p), .001)
ksmirnov Denuke if Group ==4 | Group ==1, by(Group) 
scalar c10 = round(r(D), .0001)
scalar c10p = round(r(p), .001)

ksmirnov UStroops_withdrawal if Group ==2 | Group ==1, by(Group) 
scalar a11 = round(r(D), .0001)
scalar a11p = round(r(p), .001)
ksmirnov UStroops_withdrawal if Group ==3 | Group ==1, by(Group) 
scalar b11 = round(r(D), .0001)
scalar b11p = round(r(p), .001)
ksmirnov UStroops_withdrawal if Group ==4 | Group ==1, by(Group) 
scalar c11 = round(r(D), .0001)
scalar c11p = round(r(p), .001)

ksmirnov Intl_reputation if Group ==2 | Group ==1, by(Group) 
scalar a12 = round(r(D), .0001)
scalar a12p = round(r(p), .001)
ksmirnov Intl_reputation if Group ==3 | Group ==1, by(Group) 
scalar b12 = round(r(D), .0001)
scalar b12p = round(r(p), .001)
ksmirnov Intl_reputation if Group ==4 | Group ==1, by(Group) 
scalar c12 = round(r(D), .0001)
scalar c12p = round(r(p), .001)

ksmirnov War if Group ==2 | Group ==1, by(Group) 
scalar a13 =round(r(D), .0001)
scalar a13p = round(r(p), .001)
ksmirnov War if Group ==3 | Group ==1, by(Group) 
scalar b13 =round(r(D), .0001)
scalar b13p = round(r(p), .001)
ksmirnov War if Group ==4 | Group ==1, by(Group) 
scalar c13 =round(r(D), .0001)
scalar c13p = round(r(p), .001)

ksmirnov Provo if Group ==2 | Group ==1, by(Group) 
scalar a14 = round(r(D), .0001)
scalar a14p = round(r(p), .001)
ksmirnov Provo if Group ==3 | Group ==1, by(Group) 
scalar b14 = round(r(D), .0001)
scalar b14p = round(r(p), .001)
ksmirnov Provo if Group ==4 | Group ==1, by(Group) 
scalar c14 = round(r(D), .0001)
scalar c14p = round(r(p), .001)

ksmirnov Nuclear if Group ==2 | Group ==1, by(Group) 
scalar a15 = round(r(D), .0001)
scalar a15p = round(r(p), .001)
ksmirnov Nuclear  if Group ==3 | Group ==1, by(Group) 
scalar b15 = round(r(D), .0001)
scalar b15p = round(r(p), .001)
ksmirnov Nuclear  if Group ==4 | Group ==1, by(Group) 
scalar c15 = round(r(D), .0001)
scalar c15p = round(r(p), .001)

ksmirnov Military if Group ==2 | Group ==1, by(Group) 
scalar a16 = round(r(D), .0001)
scalar a16p = round(r(p), .001)
ksmirnov Military if Group ==3 | Group ==1, by(Group) 
scalar b16 = round(r(D), .0001)
scalar b16p = round(r(p), .001)
ksmirnov Military if Group ==4 | Group ==1, by(Group) 
scalar c16 = round(r(D), .0001)
scalar c16p = round(r(p), .001)

ksmirnov Alliance if Group ==2 | Group ==1, by(Group) 
scalar a17 = round(r(D), .0001)
scalar a17p = round(r(p), .001)
ksmirnov Alliance if Group ==3 | Group ==1, by(Group) 
scalar b17 = round(r(D), .0001)
scalar b17p = round(r(p), .001)
ksmirnov Alliance if Group ==4 | Group ==1, by(Group) 
scalar c17 = round(r(D), .0001)
scalar c17p = round(r(p), .001)

ksmirnov Japan if Group ==2 | Group ==1, by(Group) 
scalar a18 = round(r(D), .0001)
scalar a18p = round(r(p), .001)
ksmirnov Japan if Group ==3 | Group ==1, by(Group) 
scalar b18 = round(r(D), .0001)
scalar b18p = round(r(p), .001)
ksmirnov Japan if Group ==4 | Group ==1, by(Group) 
scalar c18 = round(r(D), .0001)
scalar c18p = round(r(p), .001)

ksmirnov Endurance if Group ==2 | Group ==1, by(Group) 
scalar a19 = round(r(D), .0001)
scalar a19p = round(r(p), .001)
ksmirnov Endurance if Group ==3 | Group ==1, by(Group) 
scalar b19 = round(r(D), .0001)
scalar b19p = round(r(p), .001)
ksmirnov Endurance if Group ==4 | Group ==1, by(Group) 
scalar c19 = round(r(D), .0001)
scalar c19p = round(r(p), .001)

matrix A = (a1, b1, c1 \ a1p, b1p, c1p \ a2, b2, c2 \ a2p, b2p, c2p \ a3, b3, c3 \ a3p, b3p, c3p \ a4, b4, c4 \ a4p, b4p, c4p \ a5, b5, c5 \ a5p, b5p, c5p \a6, b6, c6  \ a6p, b6p, c6p \ a7, b7, c7 \ a7p, b7p, c7p \a8, b8, c8 \ a8p, b8p, c8p \a9, b9, c9  \ a9p, b9p, c9p \a10, b10, c10 \ a10p, b10p, c10p \a11, b11, c11 \ a11p, b11p, c11p \a12, b12, c12 \ a12p, b12p, c12p \a13, b13, c13 \ a13p, b13p, c13p \a14, b14, c14 \ a14p, b14p, c14p \a15, b15, c15 \ a15p, b15p, c15p \a16, b16, c16 \ a16p, b16p, c16p \a17, b17, c17 \ a17p, b17p, c17p \a18, b18, c18 \ a18p, b18p, c18p \a19, b19, c19 \ a19p, b19p, c19p ) 

matrix list A

esttab matrix(A) using table1.tex, replace star(+ 0.10 * 0.05 ** .01 *** .001) nogaps

